<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">

<div class="panel">
    <div id="targetDescHistory-heading" class="panel-heading bg-gray-light">
        <h3 class="panel-title">指标描述 历史版本<span id="title-duty-name-targetDescHistory" class="text-muted"> | </span></h3>
    </div>

    <div class="panel-body">
        <form th:id="'form_targetDescHistory_input'+${targetDescHistory?.id}" class="form-horizontal bord-btm">
            <input type="hidden" name="keyId" th:value="${targetDescHistory?.id}">
            <input type="hidden" name="targetDescId" th:value="${targetDescHistory?.targetDescId}">

            <div class="form-group">
                <label class="col-md-2 control-label">指标定义<i class="fa fa-asterisk txt-color-red"></i></label>
                <div class="col-md-8">
                    <input disabled type="text" id="targetDescDictName" th:value="${targetDescHistory?.targetDescDictName}" class="form-control" placeholder="指标定义">
                </div>
            </div>

            <div class="form-group">
                <label class="col-md-2 control-label">描述内容<i class="fa fa-asterisk txt-color-red"></i></label>
                <div class="col-md-8">
                    <textarea disabled name="content" id="content" th:text="${targetDescHistory?.content}" rows="4" class="form-control" placeholder="描述内容"></textarea>
                </div>
            </div>

            <div class="form-group">
                <label class="col-md-2 control-label">描述解释<i class="fa fa-asterisk txt-color-red"></i></label>
                <div class="col-md-8">
                    <textarea disabled name="explanation" id="explanation" th:text="${targetDescHistory?.explanation}" rows="4" class="form-control" placeholder="描述解释"></textarea>
                </div>
            </div>

            <div class="form-group">
                <label class="col-md-2 control-label">是否存在数据元<i class="fa fa-asterisk txt-color-red"></i></label>
                <div class="col-md-8">
                    <div class="radio">
                        <input disabled type="radio" name="ifYuan" id="ifYuan0" value="否" class="magic-radio" th:checked="${targetDescHistory==null || targetDescHistory?.ifYuan=='否'}" >
                        <label for="ifYuan0">否</label>
                        <input disabled type="radio" name="ifYuan" id="ifYuan1" value="是" class="magic-radio" th:checked="${targetDescHistory?.ifYuan == '是'}" >
                        <label for="ifYuan1">是</label>
                    </div>
                </div>
            </div>

            <div id="yuanDiv" class="form-group" th:hidden="${targetDescHistory==null || targetDescHistory?.ifYuan == '否'}" >
                <label class="col-md-2 control-label">指标数据元<i class="fa fa-asterisk txt-color-red"></i></label>
                <div class="col-md-8">
                    <input disabled type="text" name="yuan" id="yuan" th:value="${targetDescHistory?.yuan}" class="form-control" placeholder="指标数据元">
                </div>
            </div>

            <div class="form-group">
                <div class="jqGrid_wrapper col-md-offset-2 col-md-8">
                    <table id="targetDescHEva_table"></table>
                    <div id="targetDescHEva_page"></div>
                </div>
            </div>

            <div class="form-group">
                <div class="jqGrid_wrapper col-md-offset-2 col-md-8">
                    <table id="targetDescHZan_table"></table>
                    <div id="targetDescHZan_page"></div>
                </div>
            </div>
            
        </form>
    </div>
</div>

<script th:inline="javascript">
    var keyId_targetDescHistory = [[${targetDescHistory?.id}]];
    var flowData_targetDescHistory = {
        keyId : keyId_targetDescHistory ? keyId_targetDescHistory : "create",
        parentId : [[${targetDescHistory?.targetDescId}]],
        formId : "form_targetDescHistory_input"+[[${targetDescHistory?.id}]],
        titleId : "title-duty-name-targetDescHistory"
    };
    var $form = $("#"+flowData_targetDescHistory.formId);

    $(function(){
        init_targetDescHEav_table();
        init_targetDescHZan_table();
    });

    function init_targetDescHEav_table(){
        __init_jqgrid('targetDescHEva_table', 'targetDescHEva_page', ctx + 'targetDescEvaluate/list?id='+[[${targetDescHistory?.targetDescId}]]+'&v='+[[${targetDescHistory?.versionIndex}]],
            ["评论人","反对内容","评论时间","id"],
            [
                {name:'creatorName', index:'creator.name', width:50, search:true, sortable:false, searchoptions: {sopt: ['cn']}},
                {name:'content', index:'content', width:100, search:true, sortable:false, searchoptions: {sopt: ['cn']}},
                {name:'createTime', index:'createTime', width:100, search:true, sortable:false, searchoptions: {sopt: ['cn']}},
                {name:'id',index:'id',search:false,hidden:true}
            ], true, {
                caption : "驳论记录"
            }
        );
    }

    function init_targetDescHZan_table(){
        __init_jqgrid('targetDescHZan_table', 'targetDescHZan_page', ctx + 'targetDescZan/list?id='+[[${targetDescHistory?.targetDescId}]]+'&v='+[[${targetDescHistory?.versionIndex}]],
            ["点赞人","点赞日期","id"],
            [
                {name:'creator.name', index:'creator.name', width:50, search:true, sortable:false, searchoptions: {sopt: ['cn']}},
                {name:'createTime', index:'createTime', width:200, search:true, sortable:false, searchoptions: {sopt: ['cn']}},
                {name:'id',index:'id',search:false,hidden:true}
            ], true, {
                caption : "点赞信息"
            }
        );
    }

</script>

</html>